package properties

type Database struct {
	Driver          string             `yaml:"driver"`
	Source          string             `yaml:"source"`
	ConnMaxIdleTime int                `yaml:"conn-max-idle-time"`
	ConnMaxLifeTime int                `yaml:"conn-max-life-time" default:"600"` //单位秒
	MaxIdleConns    int                `yaml:"max-idle-conns" default:"10"`
	MaxOpenConns    int                `yaml:"max-open-conns" default:"100"`
	Registers       []DBResolverConfig `yaml:"registers"`
}

type DBResolverConfig struct {
	Sources  []string
	Replicas []string
	Policy   string
	Tables   []string
}

var (
	DatabasePrefix = "database"
	DatabaseConfig = Database{MaxOpenConns: 100, MaxIdleConns: 10, ConnMaxLifeTime: 600}
)
